package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRepairRepositoryRepairStepService;
import cc.comac.mom.bean.EquipRepairRepository;
import cc.comac.mom.bean.EquipRepairRepositoryRepairStep;
import cc.comac.mom.util.ResultBean;

@RestController
@RequestMapping("/Equip/repair/repository/RepairStep")
public class EquipRepairRepositoryRepairStepController {
	
	@Autowired
	private EquipRepairRepositoryRepairStepService equipRepairRepositoryRepairStepService;
	
	@RequestMapping(value = "/save",method = RequestMethod.POST)
	public ResultBean save(@RequestBody EquipRepairRepositoryRepairStep obj) {
		return equipRepairRepositoryRepairStepService.save(obj);
	}

	@RequestMapping(value = "/delete",method = RequestMethod.POST)
	public ResultBean delete(@RequestBody EquipRepairRepositoryRepairStep obj) {
		return equipRepairRepositoryRepairStepService.delete(obj);
	}

	@RequestMapping(value = "/update",method = RequestMethod.POST)
	public ResultBean update(@RequestBody EquipRepairRepositoryRepairStep obj) {
		return equipRepairRepositoryRepairStepService.update(obj);
	}

	@RequestMapping(value = "/saveBatch",method = RequestMethod.POST)
	public ResultBean saveBatch(@RequestBody List<EquipRepairRepositoryRepairStep> list) {
		return equipRepairRepositoryRepairStepService.save(list);
	}

	@RequestMapping(value = "/updateBatch",method = RequestMethod.POST)
	public ResultBean updateBatch(@RequestBody List<EquipRepairRepositoryRepairStep> list) {
		return equipRepairRepositoryRepairStepService.update(list);
	}

	@RequestMapping(value = "/deleteBatch",method = RequestMethod.POST)
	public ResultBean deleteBatch(@RequestBody List<EquipRepairRepositoryRepairStep> list) {
		return equipRepairRepositoryRepairStepService.delete(list);
	}

	@RequestMapping(value = "/getById/{id}",method = RequestMethod.GET)
	public EquipRepairRepositoryRepairStep getById(@PathVariable long id) {
		return equipRepairRepositoryRepairStepService.getById(id);
	}

	@RequestMapping(value = "/selectByCondition",method = RequestMethod.POST)
	public ResultBean selectByCondition(@RequestBody EquipRepairRepository obj) {
		return equipRepairRepositoryRepairStepService.selectByCondition(obj);
	}
	
	@RequestMapping(value = "/moveUp",method = RequestMethod.POST)
	public ResultBean moveUp(@RequestBody EquipRepairRepositoryRepairStep obj) {
		// TODO Auto-generated method stub
		return equipRepairRepositoryRepairStepService.moveUp(obj);
	}
	
	@RequestMapping(value = "/moveDown",method = RequestMethod.POST)
	public ResultBean moveDown(@RequestBody EquipRepairRepositoryRepairStep obj) {
		// TODO Auto-generated method stub
		return equipRepairRepositoryRepairStepService.moveDown(obj);
	}

}
